﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
    CodeFile="BrowseExternalCategory.aspx.cs" Inherits="BrowseExternalCategory" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="CenterContentPlaceHolder" runat="Server">
    <div id="lastnews">
        <asp:ListView ItemPlaceholderID="itemPlaceHolder" DataKeyNames="ID" ID="FeedItemsListView"
            runat="server" OnItemDataBound="FeedItemsListView_ItemDataBound"
            OnDataBound="FeedItemsListView_DataBound" OnSelectedIndexChanging="FeedItemsListView_SelectedIndexChanging">
            <ItemTemplate>
                <li>
                    <asp:Label ID="PubDateLabel" runat="server" EnableViewState="false"></asp:Label>
                    <a href='ViewPage.aspx?id=<%# Eval("ID") %>' />
                    <%# Eval("Title") %>
                    </a>
                    <asp:ImageButton ToolTip="Вижте откъс" Height="11px" CommandName="Select" ImageUrl="~/images/viewItemContent.png"
                        ID="ViewItemContentButton" runat="server" />
                    -
                    <asp:HyperLink ToolTip="Вижте откъс и подобни новини" Height="11px" ID="ViewExcerpt"
                        runat="server" NavigateUrl='<%# "~/ViewItem.aspx?id=" + Eval("ID") %>'>
                        <asp:Image ImageUrl="~/images/ViewExcerpt.png" runat="server" ID="ViewExcerptImage"
                            Height="11px" />
                    </asp:HyperLink>
                    -
                    <asp:HyperLink ToolTip="Източник" rel="nofollow" Height="11px" ID="HyperLinkToSource"
                        runat="server" NavigateUrl='<%# "~/Redirect.aspx?itemid=" + Eval("ID") %>'>
                        <asp:Image ImageUrl="~/images/ViewFromSource.png" runat="server" ID="SourceImage"
                            Height="11px" />
                    </asp:HyperLink>
                    - <a href='./?feedid=<%# Eval("Feed.ID") %>'>
                        <%# Eval("Feed.DisplayName") %>
                    </a>
                    <div enableviewstate="false" id="ItemContentDiv" class="ItemContentDiv" runat="server"
                        visible="false">
                    </div>
            </ItemTemplate>
            <EmptyDataTemplate>
                Няма новини
            </EmptyDataTemplate>
            <LayoutTemplate>
                <ul id="lastnews">
                    <li id="itemPlaceHolder" runat="server"></li>
                </ul>
                <asp:DataPager ID="FeedItemsDataPager" QueryStringField="page" PageSize="45" PagedControlID="FeedItemsListView"
                    runat="server">
                    <Fields>
                        <asp:NextPreviousPagerField ButtonType="Link" ShowFirstPageButton="True" ShowPreviousPageButton="True"
                            ShowNextPageButton="false" />
                        <asp:NumericPagerField ButtonCount="10" ButtonType="Link" NextPageText="Next" />
                        <asp:NextPreviousPagerField ButtonType="Link" ShowLastPageButton="True" ShowNextPageButton="True"
                            ShowPreviousPageButton="false" />
                    </Fields>
                </asp:DataPager>
            </LayoutTemplate>
        </asp:ListView>
    </div>
    <asp:LinqDataSource ID="FeedItemsDataSource" runat="server" ContextTypeName="FeedAgregator.FeedSignalDataContext"
        OrderBy="PubDate desc" Select="new (ID,PubDate, Title, Feed,SeoUrl)" TableName="FeedItems">
    </asp:LinqDataSource>
</asp:Content>
